package com.yunhe.authority.domain.company;

import com.yunhe.authority.domain.authority.Role;
import com.yunhe.common.annotation.EnumItemCode;
import io.swagger.annotations.ApiModelProperty;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.Relationship;

import java.io.Serializable;
import java.util.List;

public class Employee implements Comparable<Employee>, Serializable {
    @ApiModelProperty(value = "用户ID")
    @Id
    @GeneratedValue
    private Long id;
    @ApiModelProperty(value = "用户名")
    private String name;
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "姓名")
    private String title;
    @ApiModelProperty(value = "密码")
    private String password;
    @ApiModelProperty(value = "性别")
    private String sex;
    @ApiModelProperty(value = "性别")
    @EnumItemCode(code = "sex", fieldTitle = "sex")
    private String sexTitle;
    @ApiModelProperty(value = "邮箱")
    private String mail;
    @ApiModelProperty(value = "是否可用")
    private String activity;
    @ApiModelProperty(value = "是否可用Title")
    @EnumItemCode(code = "activity", fieldTitle = "activity")
    private String activityTitle;
    @Relationship(type = "HAS_ROLE")
    private List<Role> role;
    @ApiModelProperty(value = "新增时间")
    private String createTime;
    @ApiModelProperty(value = "更新时间")
    private String updateTime;

    @ApiModelProperty(value = "创建人")
    private String creator;
    @ApiModelProperty(value = "最后登录系统时间")
    private String lastLoginTime;
    @ApiModelProperty(value = "最后登录的系统平台")
    private String lastLoginSystem;
    @ApiModelProperty(value = "最后登录的系统平台Title")
    @EnumItemCode(code = "system",fieldTitle = "lastLoginSystem")
    private String lastLoginSystemTitle;
    @ApiModelProperty(value = "禁用描述")
    private String remark;
    @ApiModelProperty(value = "最后浏览的项目")
    private Long lastAccessProject;
    @ApiModelProperty(value = "最后浏览的项目Title")
    private String lastAccessProjectTitle;



    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getActivity() {
        return activity;
    }

    public void setActivity(String activity) {
        this.activity = activity;
    }

    public List<Role> getRole() {
        return role;
    }

    public void setRole(List<Role> role) {
        this.role = role;
    }

    public String getActivityTitle() {
        return activityTitle;
    }

    public void setActivityTitle(String activityTitle) {
        this.activityTitle = activityTitle;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSexTitle() {
        return sexTitle;
    }

    public void setSexTitle(String sexTitle) {
        this.sexTitle = sexTitle;
    }

    public String getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(String lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getLastLoginSystem() {
        return lastLoginSystem;
    }

    public void setLastLoginSystem(String lastLoginSystem) {
        this.lastLoginSystem = lastLoginSystem;
    }

    public String getLastLoginSystemTitle() {
        return lastLoginSystemTitle;
    }

    public void setLastLoginSystemTitle(String lastLoginSystemTitle) {
        this.lastLoginSystemTitle = lastLoginSystemTitle;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getLastAccessProject() {
        return lastAccessProject;
    }

    public void setLastAccessProject(Long lastAccessProject) {
        this.lastAccessProject = lastAccessProject;
    }

    public String getLastAccessProjectTitle() {
        return lastAccessProjectTitle;
    }

    public void setLastAccessProjectTitle(String lastAccessProjectTitle) {
        this.lastAccessProjectTitle = lastAccessProjectTitle;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    @Override
    public int compareTo(Employee o) {
        if (this.createTime == null) {
            return -1;
        } else if (o.getCreateTime() == null) {
            return 1;
        }
        return this.createTime.compareTo(o.getCreateTime());
    }
}
